class Person():

    def __init__(self, name, age):
        self.name = name
        self.age = age

    def print(self):
        print("Person", self.name, self.age)


# 继承父类，会将父类所有的东西都继承过来
class Student(Person):

    # 重写父类的方法
    def print(self):
        print("Student", self.name, self.age)


# 父类的引用指向子类的对象
student: Person = Student("张三", 23)

student.print()
